FIG. 1 is a block diagram of a conventional video encoder. Referring to FIG. 1, a conventional video encoder 10 includes a main control unit (MCU) 20, a motion estimation processor (MEP) 30, a motion compensation processor (MCP) 40, an internal bus system 50, a memory 60, a memory controller 70, and a camera system 80.
The MEP 30 estimates the motion of a macroblock using the difference between a previous frame and a current frame. Based on the motion estimated by the MEP 30, the MCP 40 reads from the memory 60, 16×16 blocks that are the most perfectly matched with a current macroblock in the previous frame, that is, a motion-compensated macroblock.
The memory 60 is a data storage device, such as a synchronous dynamic random access memory (SDRAM), and stores previous and present frames. The memory controller 70 controls all of the operations of the memory 50, that is, reading of a previous frame, a current frame, or a motion-compensated macroblock from the memory 60 or writing of a previous frame, a current frame, or a restored image to the memory 60.
The camera system 80 captures an image and transfers the captured image to the memory 60. Each of the MCU 20, the MEP 30, the MCP 40, the memory controller 70, and the camera system 80 is connected to the internal bus system 50 and transceives predetermined data to/from the internal bus system 50.
FIG. 2 is a flowchart illustrating a conventional image encoding method that is performed by the video encoder of FIG. 1. Referring to FIGS. 1 and 2, when an image frame captured by the camera system 80 has been stored in the memory 60, the MCU 20 produces a picture header for the image frame to be encoded and encodes the image frame a macroblock at a time. Here, a macroblock is composed of 16×16 pixels. The picture header includes data regarding the image size, the image type (e.g., intra type (I) or predicted type (P)), and the like.
The MCU 20 transfers an MEP parameter via the internal bus system 50 to the MEP 30. The MEP parameter denotes information required to calculate a moving vector, and includes an address of a current macroblock in a current frame and an address of a search area in its previous frame, the search area corresponding to the current macroblock.
The MEP 30 receives the MEP parameter and estimates a motion vector. The MEP 30 can perform another operation, such as quantization coefficient calculation, while estimating a motion vector. The time for the MEP 30 to estimate a motion vector varies. Accordingly, when motion vector estimation is completed, the MEP 30 produces an interrupt signal IRQ and transfers the same to the MCU 20. The interrupt signal IRQ interrupts the operation of the MCU 20.
In response to the interrupt signal IRQ, the MCU 20 stops calculating a quantization coefficient and outputs an MCP parameter to the MCP 40. The MCP parameter includes the motion vector estimated by the MEP 30 and the start address of the search area on the previous frame.
The MCP 40 reads a motion-compensated macroblock from the memory 60 in response to the MCP parameter. When the data reading is completed, the MCP 40 outputs the interrupt signal IRQ to the MCU 20.
In response to the interrupt signal IRQ, the MCU 20 reads the motion-compensated macroblock from the MCP 40 and calculates a difference signal. The difference signal represents the difference between the current macroblock and the motion-compensated macroblock.
The MCU 20 determines whether to process the current macroblock in an intermode or in an intramode. If it is determined to process the current macroblock in an intermode, the MCU 20 performs discrete cosine transformation (DCT) and quantization (Q) with respect to the difference between the current macroblock and the motion-compensated macroblock.
On the other hand, if it is determined to process the current macroblock in an intramode, the MCU 20 performs discrete cosine transformation (DCT) and quantization (Q) with respect to the current macroblock.
After the discrete cosine transformation (DCT) and quantization (Q), the MCU 20 produces a header for the current macroblock and performs variable length encoding with respect to a quantized coefficient. When the variable length encoding is completed, the MCU 20 performs inverse quantization (IQ) and inverse discrete cosine transformation (IDCT) with respect to the quantized coefficient.
If the current macroblock is in an intramode, the MCU 20 transfers the image restored or decoded by IQ and IDCT to the memory 60.
However, if the current macroblock is in an intermode, the MCU 20 transfers the motion vector estimated by the MEP 30 and the start address of the search area on the previous frame to the MCP 40. In response to the motion vector estimated by the MEP 30 and the start address of the search area on the previous frame, the MCP 40 reads a motion-compensated image from the memory 60 and an interrupt signal IRQ to the MCU 20.
In response to the interrupt signal IRQ, the MCU 20 adds the motion-compensated image stored in the MCP 40 to a dequantized image to produce a restored or decoded image, and stores the restored image in the memory 60. If encoding and decoding with respect to one macroblock are completed through the above-described process, the conventional video encoder 10 encodes and decodes the next macroblock.
The conventional video encoder 10 generates an interrupt signal IRQ three times to encode and decode one macroblock. Accordingly, in order to process 30 352×288 images per second, the conventional video encoder 10 generates an interrupt signal IRQ 35640 times (35640=352×288×3×30/16×16). Since the conventional video encoder 10 performs other operations during image encoding, frequent generation of the interrupt signal IRQ degrades the performance of the video encoder.
Since the MCU 20 requires tens to hundreds of cycles to process one interrupt signal IRQ, the operations of the MCU 20 other than image encoding are significantly hindered by the IRQ signal. When the MCU 20 performs DCT and Q, a significant amount of power is consumed.